package nina.yiyou.entry.run

class WorkshopErrorHandler {

  WorkshopErrorHandler(Throwable error, EntryArgParser.Arg args) {
    _error = error
    _args = args
  }

  void handle() {
    if (!_args.isFromExcel()) {
      throw _error
    }

    _error.printStackTrace()

    print('按<回车>退出...')
    System.in.read()
    System.exit(1)
  }

  private final Throwable _error

  private final EntryArgParser.Arg _args
}
